﻿@using BonjourQuotation.UI.Models.AccountModel
@model EditUserViewModel

@{
    ViewBag.Title = "Edit User";
    Layout = "~/Views/Shared/_Layout.cshtml";
    @Scripts.Render("~/Scripts/UIScript/Manage/Account.js")
}


<div class="container">
    <div class="FormsDiv">
        @using (@Html.BeginForm("EditUser", "Account", FormMethod.Post, new { @class = "form-horizontal", id = "CreateUserForm" }))
        {
            <h1>Edit User</h1>
            <div id="EditUserFormDiv">
                <div class="Lines760"></div>
                <div id="ErrorMessagesDiv" style="margin: auto;width: 760px;height: 30px;">
                    <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
                    @if (Model.Message != null)
                    {
                        @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
                    }
                </div>
                @Html.HiddenFor(model => model.UserId)
                <div class="ElementsPaddingRight30">
                    <div class="UserNameDiv">
                        @Html.TextBoxFor(model => Model.UserName, new { id = "username", @class = "username ElementsForValidation Required", placeholder = "Username" })
                    </div>
                </div>
                <div class="ElementsPaddingRight30">
                    <div class="PasswordDiv">
                        @Html.PasswordFor(model => Model.OldPassword, new { id = "oldpassword", @class = "password ElementsForValidation Required", placeholder = "Old Password" })
                    </div>
                </div>
                <div class="ElementsPaddingRight30">
                    <div class="PasswordDiv">
                        @Html.PasswordFor(model => Model.Password, new { id = "password", @class = "password ElementsForValidation MinLength4 Required", placeholder = "New Password" })
                    </div>
                </div>
                <div class="ElementsPaddingRight30">
                    <div class="PasswordDiv">
                        @Html.PasswordFor(model => Model.RePassword, new { id = "repassword", @class = "password ElementsForValidation Required", placeholder = "Repeat New Password" })
                    </div>
                </div>
                <div class="SelecteRoleDiv">
                    @Html.LabelFor(model => Model.Role, new { @class = "RoleLabel" })
                    <div class="RoleDrop">
                        @Html.DropDownListFor(x => x.SelectedRole, new SelectList(Model.Role, "Value", "Text"), new { @class = "SelecteRole" })
                    </div>
                </div>
                <div class="Lines760" id="passwordLines"></div>
                <div id="EditUserBtnDiv">
                    <button type="submit" class="btn14" id="EditUserBtn">Save</button>
                </div>
            </div>
        }
    </div>
</div>